package com.sx.epidemic_system.controller;

import com.sx.epidemic_system.service.NowPatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

@Controller
public class NowConrtoller {
    @Autowired
    private NowPatientService nowPatientService;
//查询现有确诊
    @ResponseBody
    @RequestMapping("/getNowConfirmed")
    public int getNowConfirmed(){
        return nowPatientService.getNowConfirmed();
    }
//查询现有本土
    @ResponseBody
    @RequestMapping("/getNowLocal")
    public int getNowLocal(){
        return nowPatientService.getNowLocal();
    }
//    查询现有境外
    @ResponseBody
    @RequestMapping("/getNowOverseas")
    public int getNowOverseas(){
        return nowPatientService.getNowOverseas();
    }
    //    查询现有无症状
    @ResponseBody
    @RequestMapping("/getNowAspm")
    public int getNowAspm(){
        return nowPatientService.getNowAspm();
    }

//    查询各省现有确诊
    @ResponseBody
    @RequestMapping("/getNowPvCon")
    public int getNowPvCon(String province){
        return nowPatientService.getNowPvCon(province);
    }

//    国内一栏
    @ResponseBody
    @RequestMapping("/getNow")
    public List getNow(){
        List list=new ArrayList();
        list.add(nowPatientService.getNowConfirmed());//国内现有确诊
        list.add(nowPatientService.getNowLocal());//国内现有本土
        list.add(nowPatientService.getNowOverseas());//国内现有境外
        list.add(nowPatientService.getNowAspm());//国内现有无症状
        return list;
    }
}
